import { defineComponent } from 'vue';
import { useRouter } from 'vue-router';
export default defineComponent({
    name: "cardItem",
    props: ['currentItem'],
    setup(_, {}) {
        let pathName = window.sessionStorage.getItem('userRole');
        const router = useRouter();
        const ActiveColor = new Map([
            [0, { color: '#43CF7C', txt: '剩余' }],
            [1, { color: '#E5E5E5', txt: '过期' }],
            [2, { color: 'transparent', txt: '未发布' }],
        ]);
        const activeBorder = (status) => {
        };
        const goViewDetail = () => {
            let isReview = pathName == '/review';
            router.push(isReview ? '/reviewDetail' : '/fillInDetail');
        };
        return () => (<>
                <div class="h-[96px] w-[960px] p-[0_20px] flex items-center justify-between border-(1px solid #E5E5E5) rounded-[10px] relative mb-[16px]">
                    <div class='flex justify-between items-center'>
                        <div class='border-(4px solid #e5e5e5) h-[70px] w-[70px] flex items-center justify-center flex-col rounded-100px'>
                            {!_.currentItem.status && <h3 class='text-(17px #000)' style={{ color: _.currentItem.day < 10 ? '#FF8D1A' : '#000' }}>{_.currentItem.day}天</h3>}
                            <p class='text-(14px #808080)' style={{ color: _.currentItem.status == 2 ? '#000' : '#808080' }}>{ActiveColor.get(_.currentItem.status).txt}</p>
                        </div>

                        <div class='w-[360px] ml-[22px]'>
                            <h3 class='text-(18px #000)'>{_.currentItem.title}</h3>
                            <p class='mt-[8px] text-(14px #555)'>{_.currentItem.time}</p>
                        </div>
                    </div>

                    <div class='flex items-center'>
                        <div class='text-center border-l-(1px solid #E5E5E5) p-[0_18px]'>
                            <p class='text-(20px #808080)'>{_.currentItem.c1}</p>
                            <p class='text-(14px #808080)'>问卷题数</p>
                        </div>
                        <div class='text-center border-l-(1px solid #E5E5E5) p-[0_18px]'>
                            <p class='text-(16px #808080)' style={{ color: _.currentItem.c2 ? '#FF8D1A' : '#808080' }}>{_.currentItem.c2 ? '需要' : '不需要'}</p>
                            <p class='text-(14px #808080) mt-[6px]'>文件征集</p>
                        </div>
                        <div class='text-center border-l-(1px solid #E5E5E5) p-[0_18px]'>
                            <p class='text-(16px #808080)' style={{ color: _.currentItem.c3 ? '#FF8D1A' : '#808080' }}>{_.currentItem.c3 ? '支持' : '不支持'}</p>
                            <p class='text-(14px #808080) mt-[6px]'>多项提交</p>
                        </div>
                        <div class='text-center border-l-(1px solid #E5E5E5) p-[0_18px] mr-[10px]'>
                            <p class='text-(20px #808080)'>{_.currentItem.c4}</p>
                            <p class='text-(14px #808080)'>完成提交</p>
                        </div>
                        {/* action  */}

                        {_.currentItem.status != 2 && !(_.currentItem.notAction) &&
                <div class='w-[60px] flex items-center justify-center border-(1px solid #ddd) rounded-10px text-(14px #000) p-[4px_10px] cursor-pointer' onClick={() => goViewDetail('look')}>查看</div>}


                        {_.currentItem.status == 2 && !(_.currentItem.notAction) &&
                <div class='w-[60px] flex items-center justify-center border-(1px solid #ddd) bg-#2A82E4 rounded-10px text-(14px #fff) p-[4px_10px] cursor-pointer' onClick={() => goViewDetail('edit')}>编辑</div>}


                    </div>


                    <div class={['absolute left-0 top-0 w-[5px] h-[100%]']} style={{ background: ActiveColor.get(_.currentItem.status).color }}></div>
                </div>
            </>);
    },
});
//# sourceMappingURL=cardItem.jsx.map